package com.ghck.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ghck.server.dao.provider.TreatmentPicProvider;
import com.ghck.server.model.TreatmentPic;
import com.ghck.server.model.query.TreatmentPicQuery;
/**
 * 就诊图片  <br>
 * t_treatment_pic <br>
 * v1.0 2016-05-01
 */
public interface TreatmentPicMapper {

	@DeleteProvider(method="deleteByIds",type=TreatmentPicProvider.class)
	public Integer deleteByIds(List<Integer> ids);


	/**
	 *根据id删除 就诊图片
	 */
	@Delete("delete from t_treatment_pic where id=#{id}")
	public Integer deleteById(Integer id);

	/**
	 * 批量新增 就诊图片
	 */
	@InsertProvider(method="batchInsert",type=TreatmentPicProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
	public Integer batchInsert(List<? extends TreatmentPic> treatmentPics);

	/**
	 * 新增 就诊图片
	 */
	@InsertProvider(method="insert",type=TreatmentPicProvider.class)
	@Options(useGeneratedKeys=true)
	public Integer insert(TreatmentPic domain);


	/**
	 *更新 就诊图片
	 */
	@UpdateProvider(method="update",type=TreatmentPicProvider.class)
	public Integer update(TreatmentPic domain);

	/**
	 *根据ID查询 就诊图片
	 */
	@Select("select * from t_treatment_pic where id=#{id}")
	public TreatmentPic findById(Integer id);

	/**
	 *通过query 查询 就诊图片
	 */
	@SelectProvider(method="findByQuery",type=TreatmentPicProvider.class)
	public List<TreatmentPic> findByQuery(TreatmentPicQuery query);

	/**
	 *通过query count总条数
	 */
	@SelectProvider(method="countByQuery",type=TreatmentPicProvider.class)
	public Integer countByQuery(TreatmentPicQuery query);

	/**
	 * 通过ids查询
	 */
	@SelectProvider(method="findByIds",type=TreatmentPicProvider.class)
	public List<TreatmentPic> findByIds(List<Integer> ids);

	@SelectProvider(method="findByParentIds",type=TreatmentPicProvider.class)
	public List<TreatmentPic> findByParentIds(List<Integer> parentIds);


}	